#ifndef ZL_REGEX_RICH
#define ZL_REGEX_RICH
#include "RegexAutomaton.h"

namespace zl
{
	namespace regex_internal
	{
		class CaptureRecord
		{
		public:
			zint                 capture;
			zint                 start;
			zint                 length;
			bool                 operator ==(const CaptureRecord& record)const;
		};
	};


	namespace regex_internal
	{
		class RichResult
		{
		public:
			zint                  start;
			zint                  length;
			List<CaptureRecord>   captures;
		};

		class RichInterpretor
		{
		public:
		protected:
			class UserData
			{
			public:
				bool            NeedKeepState;
			};
			Automaton::Ref        dfa;
			UserData*              datas;
		public:
			RichInterpretor(Automaton::Ref _dfa);
			~RichInterpretor();
			bool                   MatchHead(const wchar_t* input,const wchar_t* start,RichResult& result);
			bool                   Match(const wchar_t* input,const wchar_t* start,RichResult& result);
			const List<std::wstring>&   CaptureNames();
		};
	};
};

#endif
